#include <iostream>
using namespace std;
int main()
{
  // 请在此输入您的代码赛
  cout << "1 3 1 9" << endl;
  return 0;
}
#include <iostream>
using namespace std;
int main()
{
  int n,s,e,d;  cin >> n >> s >> e >>d;
  int begin1 = (s + d + n) % n,begin2 = (s - d + n) % n;
  int len1 = (e - begin1 + n) % n, len2 = (e - begin2 + n) % n,len3 = (e - s + n) % n;
  cout << min(min(len1,len2),len3) << endl;
  return 0;
}
#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
int main()
{
  string str; cin >> str;
  int n = str.size();
  unordered_map<char,int> win1,win2,win3,win0;
  for(int i = 0;i < n;i++){
    if(i % 4 == 0) win0[str[i]]++;
    else if(i % 4 == 1) win1[str[i]]++;
    else if(i % 4 == 2) win2[str[i]]++;
    else if(i % 4 == 3) win3[str[i]]++;
  }
  int ans = 0;
  int cnt0 = 0,cnt1 = 0,cnt2 = 0,cnt3 = 0;
  int tmp1 = min(win0['b'],min(win1['l'],min(win2['u'],win3['e'] )));
  ans += tmp1;
  int tmp2 = min(win0['e'],min(win1['b'],min(win2['l'],win3['u'] )));
  ans += tmp2;
  // if(tmp2 != 0){
  //   cnt0++;
  // }
  int tmp3 = min(win0['u'],min(win1['e'],min(win2['b'],win3['l'] )));
  ans += tmp3;
  // if(tmp3 != 0){
  //   cnt0++,cnt1++;
  // }
  int tmp4 = min(win0['l'],min(win1['u'],min(win2['e'],win3['b'] )));
  ans += tmp4;
  if(ans * 4 == n && tmp1 != ans){
    ans --;
  }
  cout << ans << endl;
  return 0;
}